package com.krio.spaceship.MainMenu;

import org.cocos2d.layers.*;
import org.cocos2d.menus.*;
import org.cocos2d.nodes.CCDirector;
import org.cocos2d.nodes.CCSprite;
import org.cocos2d.nodes.CCTextureCache;
import org.cocos2d.types.*;
import org.cocos2d.particlesystem.CCParticleFire;
import org.cocos2d.particlesystem.CCParticleGalaxy;
import org.cocos2d.particlesystem.CCParticleSnow;
import org.cocos2d.particlesystem.CCParticleSystem;

import com.krio.spaceship.Main.GameController;

public class MainMenuLayer extends CCLayer{
	public MainMenuLayer(){
		super();
		
		CCParticleSystem galaxy = CCParticleSnow.node();
		galaxy.setEmissionRate(6);
		galaxy.setSpeed(200);
		galaxy.setEndSpinVar(0);
		galaxy.setContentSize(CGSize.make(240, 360));
		//galaxy.setLife(4);
		galaxy.setTexture(CCTextureCache.sharedTextureCache().addImage("snow.png"));
		galaxy.setAutoRemoveOnFinish(true);
		this.addChild(galaxy);
		
		
		
		CCMenuItemLabel startItem = CCMenuItemLabel.item("start game", this, "startTapped");
		startItem.setPosition(160, 200);
		CCMenu menu = CCMenu.menu(startItem);
		menu.setPosition(0,0);
		this.addChild(menu);
	}
	
	public void startTapped(Object sender){
		GameController.showGameplayScene();
	}
}
